All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.servlet.util.Queue

java.lang.Object
   |
   +----sun.servlet.util.Queue

public class Queue
extends Object
This class implements a simple FIFO queue with fixed size. It is unlocked for added efficiency.


Variable Index

 o data
The queue data.
 o i
Index of head and tail of queue, respectively.
 o j
Index of head and tail of queue, respectively.
 o len
Current number of items in the queue.

Constructor Index

 o Queue(int)
Creates a queue with the specified size.

Method Index

 o add(Object)
Adds an object to the head of the queue.
 o empty()
Returns true if the queue is empty.
 o full()
Returns true if the queue is full.
 o remove()
Removes an item from the tail of the queue.

Variables

 o data
 protected Object data[]
The queue data.

 o i
 protected int i
Index of head and tail of queue, respectively.

 o j
 protected int j
Index of head and tail of queue, respectively.

 o len
 protected int len
Current number of items in the queue.

Constructors

 o Queue
 public Queue(int size)
Creates a queue with the specified size.

Methods

 o add
 public void add(Object obj) throws QueueFullException
Adds an object to the head of the queue.

Parameters:
obj - the object to be added
Throws: QueueFullException
if the queue was full
 o remove
 public Object remove() throws QueueEmptyException
Removes an item from the tail of the queue.

Returns:
the object to be removed
Throws: QueueEmptyException
if the queue was empty
 o empty
 public boolean empty()
Returns true if the queue is empty.

 o full
 public boolean full()
Returns true if the queue is full.


All Packages  Class Hierarchy  This Package  Previous  Next  Index